home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000123_icon-group-sender _Tue Jul 7 17:00:37 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
1KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id RAA03697
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Tue, 7 Jul 1998 17:00:36 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA08522; Tue, 7 Jul 1998 17:00:23 -0700
Message-Id: <35A2750A.E12A0673@aasaa.ofe.org>
Date: Tue, 07 Jul 1998 13:20:42 -0600
From: David Starner <dstarner98@aasaa.ofe.org>
X-Mailer: Mozilla 4.05 [en] (Win95; I)
Mime-Version: 1.0
To: icon-group@optima.CS.Arizona.EDU
Subject: Stripping excessive spaces
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 549
I've just started programming in Icon, and I came across the problem of
removing all the starting and ending spaces from a string. This was my
solution, but I think it's terribly inefficent. Can some one help me
with a better way to do this?
procedure clip(s1)
if type(s1) == "null" then fail
s1 ?:= {
tab(many(' ')) & tab(0)
}
s1 := reverse(s1)
s1 ?:= {
tab(many(' ')) & tab(0)
}
s1 := reverse(s1)
return s1
end
--
David Starner - dvdeug@hotmail.com, dstarner98@aasaa.ofe.org
GURPS: http://www.geocities.com/TimesSquare/Ring/7895/